package com.mxf.example.job;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.text.SimpleDateFormat;

public class FristJob implements Job {
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String jobName = jobExecutionContext.getJobDetail().getKey().toString();
        System.out.println(jobName + "任务开始执行：" + dateformat.format(System.currentTimeMillis()));
        System.out.println("参数："+jobExecutionContext.getTrigger().getJobDataMap().getString("name"));
        // TODO 业务job1.job1
        System.out.println(jobName + "任务执行完成：" + dateformat.format(System.currentTimeMillis()));

    }
}
